﻿<?xml version="1.0" encoding="utf-8"?>
<Witd:WITD application="Work item type editor" version="1.0" xmlns:Witd="http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef">
  <WORKITEMTYPE name="Feedback Response">
    <DESCRIPTION>This is a child work item that should be parented to a Feedback Request work item. It is assigned to the reviewer and contains the current state of the review for this reviewer.</DESCRIPTION>
    <FIELDS>
      <!-- ********** Core fields ******************* -->
      <FIELD name="Id" refname="System.Id" type="Integer" reportable="dimension" />
      <FIELD name="Title" refname="System.Title" type="String" reportable="dimension">
        <REQUIRED />
        <HELPTEXT>One line summary of the feedback response</HELPTEXT>
      </FIELD>
      <FIELD name="Description" refname="System.Description" type="HTML">
        <HELPTEXT>Feedback response from the stakeholder</HELPTEXT>
      </FIELD>
      <FIELD name="Assigned To" refname="System.AssignedTo" type="String" reportable="dimension" syncnamechanges="true">
        <ALLOWEXISTINGVALUE />
        <VALIDUSER />
        <HELPTEXT>Person responsible for next set of actions on the feedback</HELPTEXT>
      </FIELD>
      <FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" reportable="dimension" syncnamechanges="true">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
        <ALLOWEXISTINGVALUE />
      </FIELD>
      <FIELD name="State" refname="System.State" type="String" reportable="dimension">
        <HELPTEXT>Current status of the feedback response</HELPTEXT>
      </FIELD>
      <FIELD name="Reason" refname="System.Reason" type="String" reportable="dimension">
        <HELPTEXT>The reason why the feedback response is in its current state</HELPTEXT>
      </FIELD>
      <FIELD name="History" refname="System.History" type="History">
        <HELPTEXT>Discussion thread plus automatic record of changes</HELPTEXT>
      </FIELD>
      <FIELD name="Area Path" refname="System.AreaPath" type="TreePath" reportable="dimension">
        <HELPTEXT>The area of the product with which this feedback response is associated</HELPTEXT>
      </FIELD>
      <FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath" reportable="dimension">
        <HELPTEXT>The iteration within which this feedback response was requested</HELPTEXT>
      </FIELD>
      <FIELD name="Rating" refname="Microsoft.VSTS.Common.Rating" type="String" reportable="dimension">
        <ALLOWEDVALUES expanditems="true">
          <LISTITEM value="0 - Not Rated" />
          <LISTITEM value="1 - Poor" />
          <LISTITEM value="2 - Fair" />
          <LISTITEM value="3 - Good" />
          <LISTITEM value="4 - Very Good" />
          <LISTITEM value="5 - Excellent" />
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="0 - Not Rated" />
        <HELPTEXT>Overall rating provided as part of feedback response</HELPTEXT>
      </FIELD>
      <FIELD name="System Info" refname="Microsoft.VSTS.TCM.SystemInfo" type="HTML">
        <HELPTEXT>Test context, provided automatically by test infrastructure</HELPTEXT>
      </FIELD>
      <!-- **************** Team Build Integration Fields **************  -->
      <FIELD name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild" type="String" reportable="dimension">
        <SUGGESTEDVALUES expanditems="true">
          <LISTITEM value="&lt;None&gt;" />
        </SUGGESTEDVALUES>
        <HELPTEXT>The build in which the bug was fixed</HELPTEXT>
      </FIELD>
    </FIELDS>
    <!-- *************** Workflow ****************   -->
    <WORKFLOW>
      <STATES>
        <STATE value="Active">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <EMPTY />
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Closed">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <REQUIRED />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <REQUIRED />
            </FIELD>
          </FIELDS>
        </STATE>
      </STATES>
      <TRANSITIONS>
        <TRANSITION from="" to="Active">
          <REASONS>
            <DEFAULTREASON value="New" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Active" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Reviewed" />
          </REASONS>
          <FIELDS>
            <!-- Set the closing date -->
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <SERVERDEFAULT from="clock" />
            </FIELD>
            <!-- Set the closing person -->
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
            </FIELD>
            <!-- Unassign the workitem -->
            <FIELD refname="System.AssignedTo">
              <COPY from="value" value="" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
      </TRANSITIONS>
    </WORKFLOW>
    <FORM>
      <Layout HideReadOnlyEmptyFields="true" HideControlBorders="true">
        <Group Margin="(0,0,0,5)">
          <Column PercentWidth="100">
            <Control FieldName="System.Title" Type="FieldControl" ControlFontSize="large" EmptyText="&lt;Enter title here&gt;" LabelPosition="Top" />
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="70">
            <TabGroup>
              <Tab Label="Notes">
                <Control FieldName="System.Description" Type="HtmlFieldControl" Label="Stakeholder Comments" LabelPosition="Top" Dock="Fill" />
              </Tab>
              <Tab Label="Stories">
                <Control Type="LinksControl" Name="ChildLinks" Label="Stories related to this feedback" LabelPosition="Top">
                  <LinksControlOptions>
                    <WorkItemLinkFilters FilterType="include">
                      <Filter LinkType="System.LinkTypes.Related" />
                    </WorkItemLinkFilters>
                    <WorkItemTypeFilters FilterType="include">
                      <Filter WorkItemType="User Story" />
                    </WorkItemTypeFilters>
                    <ExternalLinkFilters FilterType="excludeAll" />
                    <LinkColumns>
                      <LinkColumn RefName="System.Id" />
                      <LinkColumn RefName="System.WorkItemType" />
                      <LinkColumn RefName="System.Title" />
                      <LinkColumn RefName="System.CreatedBy" />
                      <LinkColumn RefName="System.State" />
                      <LinkColumn LinkAttribute="System.Links.Comment" />
                    </LinkColumns>
                  </LinksControlOptions>
                </Control>
              </Tab>
              <Tab Label="System Info">
                <Control FieldName="Microsoft.VSTS.TCM.SystemInfo" Type="HtmlFieldControl" Label="System Info" LabelPosition="Top" Dock="Fill" />
              </Tab>
              <Tab Label="All Links">
                <Control Type="LinksControl" Name="GeneralLinks" LabelPosition="Top">
                  <LinksControlOptions>
                    <LinkColumns>
                      <LinkColumn RefName="System.ID" />
                      <LinkColumn RefName="System.Title" />
                      <LinkColumn RefName="System.AssignedTo" />
                      <LinkColumn RefName="System.State" />
                      <LinkColumn LinkAttribute="System.Links.Comment" />
                    </LinkColumns>
                    <WorkItemLinkFilters FilterType="includeAll" />
                    <ExternalLinkFilters FilterType="includeAll" />
                    <WorkItemTypeFilters FilterType="includeAll" />
                  </LinksControlOptions>
                </Control>
              </Tab>
              <Tab Label="Attachments">
                <Control Type="AttachmentsControl" Label="Attachments" LabelPosition="Top" Dock="Fill" />
              </Tab>
              <Tab Label="History">
                <Control FieldName="System.History" Type="WorkItemLogControl" Label="Histor&amp;y" LabelPosition="Top" Dock="Fill" />
              </Tab>
            </TabGroup>
          </Column>
          <Column PercentWidth="30">
            <Group Margin="(5,0,0,0)">
              <Column PercentWidth="100">
                <Group Label="Status">
                  <Column PercentWidth="100">
                    <Control ReadOnly="True" FieldName="System.CreatedBy" Type="FieldControl" Label="Created By" LabelPosition="Left" />
                    <Control FieldName="System.AssignedTo" EmptyText="&lt;No one&gt;" Type="FieldControl" Label="Assi&amp;gned To" LabelPosition="Left" />
                    <Control FieldName="System.State" Type="FieldControl" Label="Stat&amp;e" LabelPosition="Left" />
                    <Control FieldName="Microsoft.VSTS.Common.Rating" Type="FieldControl" Label="Rating" LabelPosition="Left" />
                  </Column>
                </Group>
                <Group Label="Classification">
                  <Column PercentWidth="100">
                    <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="&amp;Area" LabelPosition="Left" />
                    <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Ite&amp;ration" LabelPosition="Left" />
                  </Column>
                </Group>
              </Column>
            </Group>
          </Column>
        </Group>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</Witd:WITD>